package com.foo.cms.service.impl;

import com.foo.cms.service.BaseService;
import com.foo.cms.service.SourceService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: LZS
 * Date: 12-7-1
 * Time: 下午6:52
 * To change this template use File | Settings | File Templates.
 */
@Service
public class SourceServiceImpl extends BaseService implements SourceService{
    @Override
    public List<String> list(String id) {
        List<String> result = new ArrayList<String>();
        String sql = "select * from DT_ARTICLE_RESOURCE where numarticleid = :id ";
        Map<String,Object> params = new HashMap<String, Object>();
        params.put("id",id);
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql,params);
        for(Map<String,Object> map : list){
            result.add(String.valueOf(map.get("vc2resourceurl")));
        }
        return result;
    }
}
